package cn.lysj.framework.order.dto;

import lombok.Data;

/**
 * @author Created by zk on 2018-11-12 20:38
 * @description 消息响应体
 */
@Data
public class AjaxResp<T>{

    public enum Status {
        SUCCESS("成功", 200),
        PARAM_ERROR("参数错误", 412),
        INNER_ERROR("系统内部错误", 500);
        private String status;
        private Integer code;

        Status(String status, Integer code) {
            this.status = status;
            this.code = code;
        }
    }

    private T obj;

    private String msg;

    private Status status;

    public AjaxResp() {
    }

    public AjaxResp(T obj) {
        this.obj = obj;
        this.status = Status.SUCCESS;
    }

    public AjaxResp(T obj, String msg) {
        this.obj = obj;
        this.msg = msg;
        this.status = Status.SUCCESS;
    }

    public AjaxResp(T obj, String msg, Status status) {
        this.obj = obj;
        this.msg = msg;
        this.status = status;
    }
}
